package com.qingcloud.fexecutor.base.enums;

public enum WebWidgetTypeEnum {

    JSON(1, "脚本"),
    PICTURE(2, "图片"),
    VIDEO(3, "视频");
    public final Integer code;
    public final String name;

    WebWidgetTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static WebWidgetTypeEnum findByName(String name) {
        for (WebWidgetTypeEnum type : WebWidgetTypeEnum.values()) {
            if (type.name().equalsIgnoreCase(name)) {
                return type;
            }
        }
        return null;
    }
}
